{% extends 'templates/default_template.html' %}
{%block content%}
<h1>Request {{request.name}} #{{request.key.id}}</h1>
<p>Project: {{request.workflow.project.name}}</p>
<p>Requested by: {{request.requestor.name}}</p>
<p>Status: {{request.status}}</p>
<hr />
<h2>Request details</h2>
<p>Origin: {{request.origin}}</p>
<p>Destination: {{request.destination}}</p>
<div>
  <p>Changed files:</p>
  <ol>
    {%for file in request.files_changed %}
      <li>{{file}}</li>
    {%endfor%}
  </ol>
</div>
<div>
  <p>Required commands:</p>
  <ol>
    {%for command in request.required_commands%}
      <li>{{command}}</li>
    {%endfor%}
  </ol>
</div>
<p>Comment:</p>
<div>
  {{request.comment}}  
</div>
<hr />
<h2>Pending steps</h2>
{% if pending_steps %}
  {%for step in pending_steps %}
    <div class="">
      <p>{{step.workflow_element.name}}</p>
      <p>{{step.workflow_element.description}}</p>      
      {%if forloop.first %}<p><a href="/steps/{{step.key}}">View step details</a></p>{% endif %}
    </div>
  {%endfor%}
{% else %}
<p>There are no pending steps</p>
{% endif %}
<h2>Passed steps</h2>
{% if passed_steps %}
  {% for step in passed_steps %}
  <div class="">
    <p>{{step.workflow_element.name}}</p>
    <p>{{step.workflow_element.description}}</p>
    <p>Status: {{step.status}}</p>
    <p>Modified: {{step.modified}} by {{step.modified_by.name}}</p>
    <p><a href="/steps/{{step.key}}">View step details</a></p>
  </div>
  {% endfor %}
{% else %}
<p>There are no passed steps</p>
{% endif %}
{%endblock content%}